home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Processes / ProcessLoop.cp < prev    next >
Text File  |  1997-06-28  |  597b  |  31 lines

  1. // ProcessLoop.cp
  2.  
  3. #ifndef ProcessLoop_h
  4. #include "ProcessLoop.h"
  5. #endif
  6. #ifndef ProcessError_h
  7. #include "ProcessError.h"
  8. #endif
  9.  
  10. const ProcessSerialNumber ProcessLoop::noProcess = { 0, kNoProcess };
  11.  
  12. ProcessLoop::ProcessLoop()
  13.   : process( noProcess ),
  14.      finished( false )
  15.   {
  16.     operator++();
  17.   }
  18.  
  19. void ProcessLoop::operator++()
  20.   {
  21.     ProcessSerialNumber number( process.Number() );
  22.     
  23.     ProcessError( GetNextProcess( &number ) ).Throw();
  24.     
  25.     if ( number.highLongOfPSN == noProcess.highLongOfPSN
  26.           && number.lowLongOfPSN == noProcess.lowLongOfPSN )
  27.         finished = true;
  28.      else
  29.         process = number;
  30.   }
  31.